package com.hzhq.contract.bean.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;

/**
 * @author hzhq
 * @create 2021/3/24 5:35 下午
 * @email hzhq1255@163.com
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Document("company")
public class Company implements Serializable {

    public static final String COMPANY_ID_FIELD = "_id";
    public static final String COMPANY_NAME_FIELD = "company_name";
    public static final String ADDRESS_FIELD = "address";
    public static final String TYPE_FIELD = "type";
    public static final String PHONE_FIELD = "phone";
    public static final String EMAIL_FIELD = "email";
    public static final String DELETED_FIELD = "deleted";

    @Id
    private ObjectId companyId;
    @Indexed(unique = true)
    @ApiModelProperty(value = "公司名称")
    @Field(COMPANY_NAME_FIELD)
    private String companyName;
    @ApiModelProperty(value = "公司地址")
    @Field(ADDRESS_FIELD)
    private String address;
    @ApiModelProperty(value = "公司类型")
    @Field(TYPE_FIELD)
    private String type;
    @ApiModelProperty(value = "公司电话")
    @Field(PHONE_FIELD)
    private String phone;
    @ApiModelProperty(value = "公司邮箱")
    @Field(EMAIL_FIELD)
    private String email;
    @ApiModelProperty(value = "是否被删除")
    @Field(DELETED_FIELD)
    private Integer deleted;
}
